import request from '@/utils/request'

// 查询销售列表
export function listSales(query) {
  return request({
    url: '/business/sales/list',
    method: 'get',
    params: query
  })
}

// 查询销售详细
export function getSales(id) {
  return request({
    url: '/business/sales/' + id,
    method: 'get'
  })
}

// 新增销售
export function addSales(data) {
  return request({
    url: '/business/sales',
    method: 'post',
    data: data
  })
}

// 修改销售
export function updateSales(data) {
  return request({
    url: '/business/sales',
    method: 'put',
    data: data
  })
}

// 删除销售
export function delSales(id) {
  return request({
    url: '/business/sales/' + id,
    method: 'delete'
  })
}

// 根据收货单号查询销售单
export function getSalesByReceiptCode(receiptCode) {
  return request({
    url: '/business/sales/receipt/' + receiptCode,
    method: 'get',
  })
}
